import request from "./htttp2";

//能源类型 --- 根据应用类型组Id查询应用类型
// 
export function getAppTypeByGroupId(params) {
    return request({
        url: "/energyType/getAppTypeByGroupId",
        method: "get",
        params
 
    });
}
//能源类型 --- 查询所有应用类型组
// 
export function getAllTypeByGroup() {
    return request({
        url: "/energyType/getAllTypeByGroup",
        method: "get",
 
    });
}

//设备变量管理 => 将设备中变量添加到虚拟设备中
// 
export function saveVariable(params) {
    return request({
        url: "/virtualVariable/saveVariable",
        method: "post",
        data:params
    });
}
//设备变量管理 => 将虚拟设备中配置的变量批量移除
// 
export function deleteVariable(params) {
    return request({
        url: "/virtualVariable/deleteVariable",
        method: "DELETE",
        params
    });
}

// 获取通道设备树
export function getChannelAndDeviceTreeapi() {
    return request({
        url: "/device/getChannelAndDeviceTree.do",
        method: "post",
 
    });
}
// 获取虚拟设备树
export function getChannelAndVirtualDeviceTreeapi() {
    return request({
        url: "/virtualDevice/getDeviceTree.do",
        method: "post",
 
    });
}

//能源类型 --- 查询所有应用类型组
//
export function getVariableNamesAllByDimName(params) {
  return request({
    url: "/variable/getVariableNamesAllByDimName",
    method: "post",
    headers: {
        'Content-Type': 'multipart/form-data' // 必须手动设置
    },
    data:params
  });
}

// 	 * 变量管理->批量修改变量
export function updateAppTypeAlls (params) {
  return request({
    url: "/variable/updateAppTypeAlls",
    method: "post",
    headers: {
        'Content-Type': 'multipart/form-data' // 必须手动设置
    },
    data:params
  });
}